import { Injectable, signal } from '@angular/core';

@Injectable({
  providedIn: 'root'
})
export class LayoutService {
  private _sidebarOpen = signal(true);

  readonly sidebarOpen = this._sidebarOpen.asReadonly();

  toggleSidebar() {
    this._sidebarOpen.update(open => !open);
  }

  setSidebarOpen(open: boolean) {
    this._sidebarOpen.set(open);
  }
}
